package com.sunny.fetch.mapper;

import com.sunny.fetch.pojo.ApiMetaResult;
import com.sunny.fetch.pojo.ApiMetaResultExample;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.additional.insert.InsertListMapper;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

public interface ApiMetaResultMapper extends Mapper<ApiMetaResult>, InsertListMapper<ApiMetaResult> {
    long countByExample(ApiMetaResultExample example);

    int deleteByExample(ApiMetaResultExample example);

    List<ApiMetaResult> selectByExampleWithBLOBs(ApiMetaResultExample example);

    List<ApiMetaResult> selectByExample(ApiMetaResultExample example);

    int updateByExampleSelective(@Param("record") ApiMetaResult record, @Param("example") ApiMetaResultExample example);

    int updateByExampleWithBLOBs(@Param("record") ApiMetaResult record, @Param("example") ApiMetaResultExample example);

    int updateByExample(@Param("record") ApiMetaResult record, @Param("example") ApiMetaResultExample example);

    @Select("select b.res_name from api_meta_name a left join api_meta_result b on a.api_id=b.api_id where a.api_code=#{apiCode}")
    List<String> getResNameByCode(String apiCode);
}